package golang

import "fmt"

type Animal interface {
	Eat()
}

type Cat struct {
	color string
}

type Dog struct {
	color string
}

func (c Cat) Eat() {
	fmt.Println(c.color, "猫猫吃饭饭")
}

func (d Dog) Eat() {
	fmt.Println(d.color, "狗狗吃饭饭")
}

func main() {
	a := Cat{"黄色"}
	b := Dog{"白色"}
	a.Eat()
	b.Eat()
}
